function psi = psi_n(x,n)
x_max = max(x);
phase = rand()*pi;
% phase = 0.0;
if n==0
    psi = sqrt(1/x_max);
else
    psi = sqrt(2/x_max)*cos(2*n*pi*x/x_max+phase);
end